/**
* <p>Deck of Cards</p>
* <p>Description:CS 235 Assignment #1</p>
* @author Luke Vang
* @email luke.vang@my.uwrf.edu
* @author
Name2
* @email
name2.here@my.uwrf.edu
* @author
Name3
* @email
name3.here@my.uwrf.edu
* @date
March 1st 2013
*/

package DeckOfCards;

public class Hand {
	final private int Size = 52;
	private int size;
	private Hand temp;
	private Hand temp1;
	private Hand temp2;
	private Hand temp3;
	private Rank rank;
	private Suit suit;

	public Hand() {
		size = 0;

	}// default constructor

	public Hand(Rank rank, Suit suit) {
		this.rank = rank;
		this.suit = suit;

	}// alternate constructor

	public void swapCards(Hand[] deck1, Hand[] deck2, Hand[] deck3, int i,
			int z, int q) {
		temp1 = deck1[i]; // temp store for element in index i for deck 1
		temp2 = deck2[z];// temp2 store for element in index z for deck 2
		temp3 = deck3[q];// temp3 store for element in index q in deck 3
		System.out.println("Removed from deck 1 : " + deck1[i]);
		removeCard(deck1, i);
		System.out.println("Removd from deck 2 : " + deck2[z]);
		removeCard(deck2, z);
		System.out.println("Removed from deck 3 : " + deck3[q]);
		System.out.println('\n');
		removeCard(deck3, q);
		addCard(deck1, temp3, i); // deck 1 will take the element stored from
									// deck 3 and put it in position i of deck 1
		addCard(deck2, temp1, z); // deck 2 will take the element stored from
									// deck 1 and put it in position z of deck 2
		addCard(deck3, temp2, q); // deck 3 will take the element stored from
									// deck 2 and put it in position q of deck 3
		System.out.println("Added to deck 1 : " + deck1[i]);
		System.out.println("This is the new deck 1 : ");
		print(deck1);
		System.out.println("Added to deck 2 : " + deck2[z]);
		System.out.println("This is the new deck 2 : ");
		print(deck2);
		System.out.println("Added to deck 3 : " + deck3[q]);
		System.out.println("This is the new deck 3 : ");
		print2(deck3);

	}

	public void addCard(Hand[] card, Hand stuff, int i) {
		card[i] = stuff;
	}

	public void removeCard(Hand[] card, int i) {
		temp = card[i];
		card[i] = null;
	}

	public int getSize(Hand[] stuff) {
		return size = stuff.length;
	}

	public void print(Hand[] deck) {
		System.out.println('\n');
		for (int i = 0; i < 17; i++) {
			System.out.println(deck[i]);
		}
		System.out.println('\n');
	}

	public void print2(Hand[] stuff) {
		System.out.println('\n');
		for (int i = 0; i < 18; i++) {
			System.out.println(stuff[i]);
		}
	}

	public String toString() {
		return this.rank + " of " + this.suit;

	}// end of to String method

}
